<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性布局 - 组件演示</title>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div class="container">
        <header class="header">
            <h1>🚀 openHarmony_Cordova_NutpiDesign</h1>
            <p class="subtitle">组件演示 - 弹性布局组件</p>
        </header>

        <nav class="demo-nav">
            <a href="../index.html" class="nav-back">← 返回首页</a>
        </nav>

        <main class="main-content">
            <section class="demo-section">
                <h2>📦 弹性布局演示</h2>
                
                <div class="demo-content">
                    <h3>水平布局</h3>
                    <div style="display: flex; gap: 8px; margin: 20px 0;">
                        <div class="flex-item">项目1</div>
                        <div class="flex-item">项目2</div>
                        <div class="flex-item">项目3</div>
                    </div>

                    <h3>垂直布局</h3>
                    <div style="display: flex; flex-direction: column; gap: 8px; margin: 20px 0;">
                        <div class="flex-item">项目1</div>
                        <div class="flex-item">项目2</div>
                        <div class="flex-item">项目3</div>
                    </div>

                    <h3>居中对齐</h3>
                    <div style="display: flex; justify-content: center; gap: 8px; margin: 20px 0; padding: 20px; background: white; border-radius: 4px;">
                        <div class="flex-item">项目1</div>
                        <div class="flex-item">项目2</div>
                        <div class="flex-item">项目3</div>
                    </div>

                    <h3>两端对齐</h3>
                    <div style="display: flex; justify-content: space-between; gap: 8px; margin: 20px 0; padding: 20px; background: white; border-radius: 4px;">
                        <div class="flex-item">项目1</div>
                        <div class="flex-item">项目2</div>
                        <div class="flex-item">项目3</div>
                    </div>

                    <h3>自适应宽度</h3>
                    <div style="display: flex; gap: 8px; margin: 20px 0;">
                        <div class="flex-item" style="flex: 1;">项目1</div>
                        <div class="flex-item" style="flex: 2;">项目2</div>
                        <div class="flex-item" style="flex: 1;">项目3</div>
                    </div>

                    <h3>垂直居中</h3>
                    <div style="display: flex; align-items: center; gap: 8px; margin: 20px 0; padding: 20px; background: white; border-radius: 4px; min-height: 100px;">
                        <div class="flex-item">项目1</div>
                        <div class="flex-item">项目2</div>
                        <div class="flex-item">项目3</div>
                    </div>
                </div>
            </section>

            <section class="demo-section">
                <h2>使用代码</h2>
                <pre><code>// 水平布局
&lt;div style="display: flex; gap: 16px;"&gt;
    &lt;div&gt;项目1&lt;/div&gt;
    &lt;div&gt;项目2&lt;/div&gt;
&lt;/div&gt;

// 垂直布局
&lt;div style="display: flex; flex-direction: column; gap: 16px;"&gt;
    &lt;div&gt;项目1&lt;/div&gt;
    &lt;div&gt;项目2&lt;/div&gt;
&lt;/div&gt;

// 居中对齐
&lt;div style="display: flex; justify-content: center; align-items: center;"&gt;
    &lt;div&gt;项目&lt;/div&gt;
&lt;/div&gt;</code></pre>
            </section>
        </main>

        <footer class="footer">
            <p>&copy; 2025 OpenHarmony 三方库适配中心 | MIT License</p>
        </footer>
    </div>

    <style>
        .demo-content {
            background: var(--bg-light);
            padding: 20px;
            border-radius: 8px;
        }

        .demo-content h3 {
            margin-top: 20px;
            margin-bottom: 10px;
            font-size: 14px;
            color: var(--text-primary);
        }

        .flex-item {
            background: white;
            border: 1px solid var(--border-color);
            padding: 12px;
            border-radius: 4px;
            font-size: 12px;
            color: var(--text-secondary);
        }
    </style>
</body>
</html>
